#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdbool.h>
#include <string.h>

bool canPermutePalindrome(char* s) {
    int hash[127] = { 0 };
    int n = strlen(s);
    int falg = 0;
    while (*s)
    {
        hash[*s++]++;
    }
    for (int i = 0; i < 127; i++)
    {
        if (hash[i] % 2 == 1)
        {
            if (falg)
                return false;
            else
                falg = 1;
        }
    }
    return true;
}

int main()
{
    char* s = "tactcoa";
    printf("%d\n", canPermutePalindrome(s));
    return 0;
}